/*
 * @Description: 
 * @Author: paddies
 * @Date: 2024-11-17 20:54:26
 * @LastEditors: paddies
 * @LastEditTime: 2025-09-13 10:16:03
 * @FilePath: /shared_components/lib/luntai-components/new-login-panel/components/buildBanner.dart
 */
import 'package:flutter/material.dart';
import 'package:get/get.dart';

Widget buildBanner(
    {required BuildContext context, bool hasBack = false, Widget? solt}) {
  var width = MediaQuery.of(context).size.width;
  var barHeight = MediaQuery.of(context).padding.top;

  return Container(
      width: double.infinity,
      height: width * 0.68,
      decoration: const BoxDecoration(
        image: DecorationImage(
          image: AssetImage('assets/images/login/top.png'),
          fit: BoxFit.fitWidth,
        ),
      ),
      child: Stack(
        children: [
          Visibility(
              visible: hasBack,
              child: Align(
                  alignment: Alignment.topCenter,
                  child: Padding(
                    padding: EdgeInsets.only(top: barHeight),
                    child: Container(
                      width: double.infinity,
                      height: 45,
                      color: Colors.transparent,
                      // child: Icon(Icons.chevron_left_outlined),
                      child: Row(
                        children: [
                          GestureDetector(
                            onTap: () {
                              Get.back();
                            },
                            child: Container(
                              width: 80,
                              height: double.infinity,
                              color: Colors.transparent,
                              child: Icon(
                                Icons.chevron_left_outlined,
                                size: 30,
                              ),
                            ),
                          )
                        ],
                      ),
                    ),
                  ))),
          Padding(
              padding: const EdgeInsets.only(left: 30),
              child: Align(
                  alignment: Alignment.centerLeft,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        const SizedBox(
                          height: 30,
                        ),
                        solt ?? Container(),
                      ])))
        ],
      ));
}
